]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
TelepathyClient: use polari for IRC channels
authorGiovanni Campagna <scampa.giovanni@gmail.com>
Mon, 2 Mar 2015 09:34:06 +0000 (01:34 -0800)
committerGiovanni Campagna <scampa.giovanni@gmail.com>
Tue, 3 Mar 2015 00:21:38 +0000 (16:21 -0800)
polari is the GNOME app for IRC, empathy is for everything else
So prefer polari to empathy for IRC channels. We don't need
to check that either exists (even though polari is not a core
app) because mission control tries every handler if the preferred
one fails.
Depends on bug 745418 for polari to be mission control activatable.

https://bugzilla.gnome.org/show_bug.cgi?id=745431

js/ui/components/telepathyClient.js

index 881d99881a5f3f9290ab325d48a66aaf7413d92f..0690fedd6372e09bd3c34151764f851004ba0a0d 100644 (file)
@@ -537,10 +537,17 @@ const ChatSource = new Lang.Class({
 
     open: function() {
         if (this._client.is_handling_channel(this._channel)) {
-            // We are handling the channel, try to pass it to Empathy
-            this._client.delegate_channels_async([this._channel],
-                                                 global.get_current_time(),
-                                                 'org.freedesktop.Telepathy.Client.Empathy.Chat', null);
+            // We are handling the channel, try to pass it to Empathy or Polari
+            // (depending on the channel type)
+            // We don't check if either app is availble - mission control will
+            // fallback to something else if activation fails
+
+            let target;
+            if (this._channel.connection.protocol_name == 'irc')
+                target = 'org.freedesktop.Telepathy.Client.Polari';
+            else
+                target = 'org.freedesktop.Telepathy.Client.Empathy.Chat';
+            this._client.delegate_channels_async([this._channel], global.get_current_time(), target, null);
         } else {
             // We are not the handler, just ask to present the channel
             let dbus = Tp.DBusDaemon.dup();